package com.dc.designPattern._23_specification.impl.step3.spec;

import com.dc.designPattern._23_specification.impl.step3.User;

/**
 * Description: 规格模式_Not操作实现
 * @author: gdc
 * @date: 2021/8/20
 * @version 1.0
 */
public class NotSpecification extends BaseUserSpecification {

    private IUserSpecification spec;

    public NotSpecification(IUserSpecification spec) {
        this.spec = spec;
    }

    @Override
    public boolean isSatisfiedBy(User user) {
        return !spec.isSatisfiedBy(user);
    }
}
